import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

const routes = [

  {
    path: "/layout",
    name: "layout",
    component: () =>
      import("../layout/index"),
    children: [
      {
        path: "/findMusic/",
        name: "findMusic",
        meta: {index:1},
        component: () =>
          import("../views/findMusic"),
      },
      {
        path: "/myMusic",
        name: "myMusic",
        meta: {index:2},
        component: () =>
          import("../views/myMusic"),
      },
      {
        path: "/Friend",
        name: "Friend",
        meta: {index:3},
        component: () =>
          import("../views/Friend"),
      },
      {
        path: "/account",
        name: "account",
        meta: {index:4},
        component: () =>
          import("../views/account"),
      },
      

    ]
  },
  {
    path:"/",
    name:"login",
    meta: {index:0},
    component: () =>
    import("../views/login")
  },
  {
    path:"/playlist",
    name:"playlist",
    meta: {index:5},
    component: () =>
    import("../views/playlist")
  },
  {
    path:"/play",
    meta: {index:6},
    name:"play",
    component: () =>
    import("../views/play")
  },
];

const router = new VueRouter({
  routes,
});

export default router;
